import request from '@/utils/request'
import { CHECC_API_CMS } from '@/constants/proxy'


// 获取全部权限数据
export function getJurisdictionrList(parms,data) {
  return request({
    url: CHECC_API_CMS + '/sys-power/page',
    method: 'post',
    data,
    params: parms,
    
  })
}

export function getPowerList(params) {
  return request({
    url: CHECC_API_CMS + '/role/getList',
    method: 'post',
    data: {
      'roleName': '', 'roleType': '1',
      ...params,
    }
  })
}

export function getPowers(data) {
  return request({
    url: CHECC_API_CMS + '/role/getList',
    method: 'post',
    data
  })
}

// 根据主键删除权限
export function deletePower(data) {
  return request({
    url: CHECC_API_CMS + '/sys-power/',
    method: 'delete',
    data
  })
}

// 添加权限
export function addPower(data) {
  return request({
    url: CHECC_API_CMS + '/sys-power',
    method: 'post',
    data: data
  })
}

/**
 * 更新权限
 * @param data
 */
export function updatePower(data) {
  return request({
    url: CHECC_API_CMS + '/sys-power',
    method: 'put',
    data: data
  })
}

/**
 * 根据权限id查找菜单
 * @param id
 */
export function findPowerMenus(powerId) {
  return request({
    url: CHECC_API_CMS + `/sys-power/findPowerMenus/${powerId}`,
    method: 'get'
  })
}


